function tabChange(obj,id){
	$(obj).parent().find('li').removeClass('zph_net_nav_cur');
	$(obj).attr('class','zph_net_nav_cur');
	$(".zphnetdiv").addClass("none");
	$("#"+id).removeClass("none");
	$("#boxtype").val(id);
	if(id == 'hall'){
		$("#ztype").val('resume');
	}else{
		$("#ztype").val('job');
	}
}
function zphend(){
	layer.open({
		title : [ '温馨提示', 'background-color: #FF4351; color:#fff;' ],
		content : '本场招聘会已结束 , 去逛逛其他招聘会吧~',
		btn : [ '确认', '取消' ],
		shadeClose : false,
		yes : function() {
			history.back();
		}
	});
}
function noresume(){
	layer.open({
		title : [ '温馨提示', 'background-color: #FF4351; color:#fff;' ],
		content : '您还没有简历,先去创建简历?',
		btn : [ '确认', '取消' ],
		shadeClose : false,
		yes : function() {
			window.location.href = wapurl + "member/index.php?c=expect&a=add";
		}
	});
}

function clickZphnet(zid) {
	layer_load();
	$.post(wapurl + "/index.php?c=zphnet&a=ajaxZphnet",{zid : zid}, function(data) {
		layer.closeAll();
		var data = eval('(' + data + ')');
		if (data.status == 1) {	// 报名成功
			layermsg(data.msg,2,function(){
				location.reload();
			});
		} else if (data.status == 2) {
			 
			layer.open({
				title : [ '温馨提示', 'background-color: #FF4351; color:#fff;' ],
				content : data.msg,
				btn : [ '确认', '取消' ],
				shadeClose : false,
				yes : function() {
					window.location.href = wapurl + "member/index.php?c=server&server=zphnet&id=" + zid;
				}
			});
			 
		} else{ 
			if(data.login == 1){
				pleaselogin('您还未登录企业账号，是否登录？',wapurl+'/index.php?c=login')
			}else{
				layermsg(data.msg, 2, 8);return false;
			}
		}
	})
}
function zphnetLook(id, comid, jobid, url){
	layer_load();
	var param = {
		id: id, 
		comid: comid
	};
	if(jobid != ''){
		param.jobid = jobid;
	}
	$.post(wapurl + "index.php?c=zphnet&a=setLook",param, function(data) {
		layer.closeAll('loading');
		window.location.href = url;
	});
}

function getComList(){
	layer_load();
	var zid = $("#zid").val();
	var param  =  {
		zid: zid,
		page: page,
		keyword: searchKeyword
	};
	$.post(wapurl + "index.php?c=zphnet&a=getComList",param, function(data) {
		layer.closeAll('loading');
		if(data){
			var data = eval('(' + data + ')');
			if(data && data.com){
				var comlist = data.com;
				if(comlist && comlist.length > 0){
					var html = '';
					for(var i in comlist){
						html += '<div class="zph_net_list">';
						html += '<div class="zph_net_list_c">';
						html += '<div onclick="zphnetLook(\''+ zid +'\',\''+ comlist[i].uid +'\',\'\',\'index.php?c=company&a=show&id='+ comlist[i].uid +'\')">';
						html += '<div class="zph_net_list_pic"><img src="' + comlist[i].logo + '"></div>';
						html += '<div class="zph_net_list_comname">' + comlist[i].comname + '</div>';
						html += '</div>';
						html += '<div class="zph_net_list_joblist">';
						for(var j in comlist[i]['job']){
							html += '<div class="zph_net_list_job"  onclick="zphnetLook(\''+ zid +'\',\''+ comlist[i]['job'][j].uid +'\',\''+ comlist[i]['job'][j].id +'\',\'index.php?c=job&a=comapply&id='+ comlist[i]['job'][j].id +'\')">';
							html += '<i class="zph_net_list_icon"></i>' + comlist[i]['job'][j].name + '</div>';
						}
						html += '</div><div class="zph_net_list_joball">共有' + comlist[i]['jobnum'] + '个在招职位</div>';
						html += '<div class="zph_net_list_gt">';
						if(parseInt(zphetime) <0 ){
							html += '<a href="javascript:void(0)" onclick="zphend()">立即沟通</a>';
						}else if(comlist[i]['job']){
							html += '<a href="javascript:void(0)" onclick="jobChat(\''+ comlist[i]['job'][j].uid +'\',\'com\',\'' + usertype + '\',\''+ sy_chat_name +'\',\''+ sy_user_change +'\',this)" data-zid="'+ zid +'">立即沟通</a>';
						}
						html += '</div>';
						html += '</div></div>';
					}
					$("#comdiv").html(html);
				}
			}
		}
	});
}
function compage(id){
	if(id == '1'){
		page--;
	}else{
		page++;
	}
	if(page < 0){
		page = 1;
	}else if (page > parseInt(comPageAll)){
		page = compage;
	}
	$(".comPageSelect").removeAttr('selected');
	$("#compage_"+page).attr('selected','selected');
	getComList();
}
function toZphnetComPage(){
	var obj = document.getElementById("zphnetComPage");
	page = obj.options[obj.selectedIndex].value;
	$(".comPageSelect").removeAttr('selected');
	$("#compage_"+page).Attr('selected','selected');	getComList();
}